﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EDMDesigner.Business.AssociationBase
{
    public static class CardinalityStringConverter
    {
        public static Cardinality CardinalityFromString(string cardinality)
        {
            switch (cardinality)
            {
                case "1":
                    return Cardinality.One;
                case "0..1":
                    return Cardinality.ZeroToOne;
                case "*":
                    return Cardinality.Many;
            }
            throw new NotImplementedException();
        }

        public static string CardinalityToSTring(Cardinality cardinality)
        {
            switch (cardinality)
            {
                case Cardinality.One:
                    return "1";
                case Cardinality.ZeroToOne:
                    return "0..1";
                case Cardinality.Many:
                    return "*";
            }
            throw new NotImplementedException();
        }
    }
}
